class ReportsController < ResourceController
  def index
    @reports = Report.find(:all)
  end
  
  def new
    @report.post_id = params[:post_id]
  end
  
  def create
    @report.user = current_user
    if @report.save
      flash[:notice] = "Report submitted"
      redirect_to topic_post_path(@report.post_id)
    else
      render :action => 'new'
    end
  end
  
  def destroy
    @report.destroy
    flash[:notice] = "Successfully destroyed report"
    redirect_to reports_path
  end
end
